<?php
class ShopHTML {	
	function left_menu() {
		$html = '<div id="community-wrap">
	<div id="jsMenu">
		<div class="jsMenuLft">
			<a
				href="index.php?option=com_business"
				class="jsHome jsIr">Home</a>
			<div class="jsMenuBar">
				<ul class="cResetList clrfix">
					<li><a
						href="index.php?option=com_business&view=productmanager"
						class="active">Product Manager</a>
						<ul class="cResetList clrfix">
							<li><a
								href="index.php?option=com_business&view=productmanager">
									Product Manager</a></li>
							<li><a
								href="index.php?option=com_business&view=producttypemanager">
									Product Type</a></li>
							<li><a
								href="index.php?option=com_business&view=productunitmanager">
									Product Unit</a></li>
							<li><a
								href="index.php?option=com_business&view=agentmanager">
									Agent Manager</a></li>
							<li><a
								href="index.php?option=com_business&view=productmanager">
									Product Manager</a></li>
							<li><a
								href="index.php?option=com_business&view=productmanager">
									Product Manager</a></li>
							 
						</ul></li>
					<li><a
						href="index.php?option=com_business&view=warehouse">WareHouse Manager</a>
						<ul class="cResetList clrfix">
							 <li><a href="index.php?option=com_business&view=warehouse">Warehouse Manager</a></li>
							 <li><a href="index.php?option=com_business&view=warehouse">Warehouse Manager</a></li>
							 <li><a href="index.php?option=com_business&view=warehouse">Warehouse Manager</a></li>
							 <li><a href="index.php?option=com_business&view=warehouse">Warehouse Manager</a></li>
							 <li><a href="index.php?option=com_business&view=warehouse">Warehouse Manager</a></li>
						</ul></li>
					 
					<li class="no-child"><a
						href="index.php?option=com_business&view=financial">Financial Manager</a>
					</li>
					 
				</ul>
			</div>
			 
		</div>
		<div class="jsMenuRgt">
			<div class="jsLogOff">
				<form
					action=""
					method="post" name="adminshop" id="adminshop">
					<a href="javascript:void(0);" title="Logout"
						onclick="document.adminshop.submit();" class="jsIr">Logout</a>
					<input type="hidden" name="option" value="com_user"> <input
						type="hidden" name="task" value="logout"> <input type="hidden"
						name="return"
						value="'.base64_encode(JRoute::_('index.php?option=com_business')).'">
					'.JHTML::_( 'form.token' ).'
				</form>
			</div>
		</div>
	</div>


</div>
';
		return $html;
	}
	function loadButonX($task, $name = 'Mặc định', $msg = "Vui lòng chọn Năm Học Mặc Định", $icon = 'default') {
		$cmsbtcancel = '
						<td class="pnc-button" id="toolbar-' . $icon . '"><a href="#"
							onclick="javascript:if(document.adminForm.boxchecked.value==0){alert(\'' . $msg . '\');}else{  submitbutton(\'' . $task . '\')}"
							class="toolbar"> <span class="icon-32-' . $icon . '"
								title="' . $name . '"></span> ' . $name . '
						</a></td>
						';
		return $cmsbtcancel;
	}
	function loadButon($task, $name = 'Quay Lại', $icon = 'cancel') {
		$cmsbtcancel = '
						<td class="pnc-button" id="toolbar-' . $icon . '"><a href="#"
							onclick="javascript: submitbutton(\'' . $task . '\')" class="toolbar">
								<span class="icon-32-' . $icon . '" title="' . $name . '"></span> ' . $name . '
						</a></td>
						';
		return $cmsbtcancel;
	}
	function loadCustom($task, $name = 'Custom', $icon = 'excel') {
		$cmsbtcancel = '
						<td class="pnc-button" id="toolbar-' . $icon . '"><a href="' . $task . '"
							class="toolbar"> <span class="icon-32-' . $icon . '"
								title="' . $name . '"></span> ' . $name . '
						</a></td>
						';
		return $cmsbtcancel;
	}
	function getToolbar($ToolbarName, $ToolbarIcon = 'school', $ButonOption = array()) {
		if (! empty ( $ButonOption )) {
			foreach ( $ButonOption as $key ) {
				$loadbuton = 'load' . $key ['type'];
				if ($key ['type'] == 'ButonX')
					$buton .= ShopHTML::$loadbuton ( $key ['task'], $key ['name'], $key ['msg'], $key ['icon'] );
				else
					$buton .= ShopHTML::$loadbuton ( $key ['task'], $key ['name'], $key ['icon'] );
			}
		}
		$html = '

<div id="toolbar-box">
	 <div class="left"></div>
		<div class="center">
			<table class="toolbar">
				<tbody>
					<tr>' . $buton . '
					</tr>
				</tbody>
			</table>
			<div class="header icon-48-' . $ToolbarIcon . '">' . $ToolbarName . '</div>
		</div>
		<div class="right"></div>
	  
	 
</div>

';
		return $html;
	}
	function enable(&$row, $i, $imgY = 'tick.png', $imgX = 'enable.png', $prefix = '') {
		$img = $row->enable ? $imgY : $imgX;
		$task = $row->enable ? 'disable' : 'enable';
		$alt = $row->enable ? JText::_ ( 'Enable' ) : JText::_ ( 'Disable' );
		$action = $row->enable ? JText::_ ( 'Disable Item' ) : JText::_ ( 'Enable item' );
		$href = '
<a href="javascript:void(0);"
	onclick="return listItemTask(\'cb' . $i . '\',\'' . $prefix . $task . '\')"
	title="' . $action . '"> <img
	src="components/com_business/assets/images/' . $img . '" border="0"
	alt="' . $alt . '" /></a>
';
		return $href;
	}
	function tooltip($tooltip, $title='', $image='user.png', $text='', $href='', $link=1)
	{
		$tooltip	= addslashes(htmlspecialchars($tooltip, ENT_QUOTES, 'UTF-8'));
		$title		= addslashes(htmlspecialchars($title, ENT_QUOTES, 'UTF-8'));
	
		if ( !$text ) {
			$image 	= JURI::root(true).'/components/com_business/assets/images/'. $image;
			$text 	= '<img src="'. $image .'" border="0" alt="'. JText::_( 'Tooltip' ) .'"/>';
		} else {
			$text 	= JText::_( $text, true );
		}
	
		if($title) {
			$title = $title.'::';
		}
	
		$style = 'style="text-decoration: none; color: #333;"';
	
		if ( $href ) {
			$href = JRoute::_( $href );
			$style = '';
			$tip = '<span class="editlinktip hasTip" title="'.$title.$tooltip.'" '. $style .'><a href="'. $href .'">'. $text .'</a></span>';
		} else {
			$tip = '<span class="editlinktip hasTip" title="'.$title.$tooltip.'" '. $style .'>'. $text.'</span>';
		}
	
		return $tip;
	}
}
